<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="../../resources/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script src="../../resources/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../resources/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
    <script src="../../resources/lib/jquery/jquery.form.min.js" type="text/javascript"></script>
    <script src="../../resources/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
    <script type="text/javascript">
        var tree = null;
        var addNew = false;
        var myaccount = '../../resources/lib/ligerUI/skins/icons/myaccount.gif';
        var memeber = '../../resources/lib/ligerUI/skins/icons/memeber.gif';
        var archives = '../../resources/lib/ligerUI/skins/icons/archives.gif';

        $(function ()
        {
            $("#txt1").ligerComboBox({
                width : 180,
                selectBoxWidth: 200,
                selectBoxHeight: 200, valueField: 'text', treeLeafOnly: false,
                tree: { url: 'json.txt',ajaxType:'get'}
            });
            $("#txt2").ligerComboBox({
                width : 180,
                selectBoxWidth: 200,
                selectBoxHeight: 200, valueField: 'text', treeLeafOnly: false,
                tree: { url: 'json.txt',ajaxType:'get'}
            });
           $("#txt3").ligerComboBox({
                width : 180,
                selectBoxWidth: 200,
                selectBoxHeight: 200, valueField: 'text', treeLeafOnly: false,
                tree: { url: 'json.txt',ajaxType:'get'}
            });

            tree = $("#tree2").ligerTree({
                checkbox: false,
                data: [
                    { text: '主控制器1', id:"1", type:"mc"},
                    { text: '主控制器2', id:"2", type:'mc'},
                    { text: '主控制器3', id:"3", type:'mc'},

                    { text: '门控器1', id:"1.1", pid:"1", icon: myaccount, type:'dc'},
                    { text: '门控器2', id:"1.2", pid:"1", icon: myaccount, type:'dc'},

                    { text: '1号门', id:"1.1.1", pid:"1.1", icon: archives, type:'door' },
                    { text: '2号门', id:"1.1.2", pid:"1.1", icon: archives, type:'door' }
                ],
                idFieldName :'id',
                parentIDFieldName :'pid',
                onSelect: function(node, target) {
                    addNew = false;
                    var type = node.data.type;
                    if (type == 'mc') {
                        $("#dcForm").hide();
                        $("#doorForm").hide();
                        $("#doorForm1").hide();
                        $("#doorForm2").hide();

                        $("#mcForm").show();

                        $("#mcForm input[name=name]").val(node.data.text);
                        $("#mcForm input[name=id]").val(node.data.id);

                        $("#addDCItemBtn").show();
                        $("#addDoorItemBtn").hide();
                    } else if (type == 'dc') {
                        $("#mcForm").hide();
                        $("#doorForm").hide();
                        $("#doorForm1").hide();
                        $("#doorForm2").hide();

                        $("#dcForm").show();

                        $("#dcForm input[name='name']").val(node.data.text);
                        $("#dcForm input[name=id]").val(node.data.id);
                        $("#dcForm input[name=pid]").val(null);// 删除pid属性

                        $("#addDCItemBtn").show();
                        $("#addDCItemBtn").hide();
                        $("#addDoorItemBtn").show();
                    } else if (type == 'door') {
                        $("#mcForm").hide();
                        $("#dcForm").hide();
                        $("#doorForm").show();
                        $("#doorForm1").show();
                        $("#doorForm2").show();

                        $("#doorForm input[name='name']").val(node.data.text);
                        $("#doorForm1 input[name='name']").val(node.data.text);
                        $("#doorForm2 input[name='name']").val(node.data.text);

                        $("#doorForm input[name=id]").val(node.data.id);
                        $("#doorForm2 input[name=id]").val(node.data.id);

                        $("#doorForm input[name=pid]").val(null);// 删除pid属性
                        $("#doorForm1 input[name=pid]").val(null);// 删除pid属性
                        $("#doorForm2 input[name=pid]").val(null);// 删除pid属性


                        $("#addDCItemBtn").hide();
                        $("#addDoorItemBtn").hide();
                    }
                }
            });
            $("form").ligerForm();
            $('#mcForm').ajaxForm(function() {
                alert("mc form ajax submit end!");
            });
            $('#dcForm').ajaxForm(function() {
                alert("dc form ajax submit end!");
            });
            $('#doorForm').ajaxForm(function() {
                alert("door form ajax submit end!");
            });
            $('#doorForm1').ajaxForm(function() {
                alert("door form ajax submit end!");
            });
            $('#doorForm2').ajaxForm(function() {
                alert("door form ajax submit end!");
            });
        });
        function reload() {
            tree.clear();
            var data = [
                { text: '主控制器1', id:"1", type:"mc"},
                { text: '主控制器2', id:"2", type:'mc'},
                { text: '主控制器3', id:"3", type:'mc'},

                { text: '门控器1', id:"1.1", pid:"1", icon: myaccount, type:'dc'},
                { text: '门控器2', id:"1.2", pid:"1", icon: myaccount, type:'dc'},

                { text: '1号门', id:"1.1.1", pid:"1.1", icon: archives, type:'door' },
                { text: '2号门', id:"1.1.2", pid:"1.1", icon: archives, type:'door' }
            ];
            tree.setData(data);
        }

        function updateItem() {

        }
        function removeItem() {

        }
    </script>
    <style type="text/css">
        .l-table-edit {}
        .l-table-edit-td{ padding:4px;}
        .l-button-submit,.l-button-reset{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
        fieldset {
            border: solid #CCCCCC 1px;
            padding: 10px;
        }
        fieldset legend {
            padding: 0 2px;
        }
    </style>
</head>
<body id="layout1" style="width:100%; margin:0 auto;">
<div style="position:absolute; left: 5px; top: 5px; right: 5px; height: 25px; ">
    <a class="l-button" onclick="reload()" style="float:left;margin-right:10px;">重新加载</a>
    <div id="searchbar">
    &nbsp门名称：<input id="txtKey" type="text" />
    <input id="btnOK"  class="l-button" type="button" value="搜索" onclick="f_search()" />
</div>
    <br style="clear: both;" />
</div>
<div style="position:absolute; left: 5px; top: 35px; bottom: 5px; width: 190px; border:1px solid #ccc; overflow:auto;  ">
    <ul id="tree2">
    </ul>
</div>

<div style="position:absolute; left: 202px; right: 5px; top: 35px; bottom: 5px; border:1px solid #ccc; overflow:auto; padding: 5px;">
    <div id="dialog_target"  style="margin:5px;">
        <div id="navtab1" style="width: 900px; overflow: hidden; border: 1px solid #D3D3d3;" class="liger-tab">
            <div tabid="home" title="基本信息设置" lselected="true" style="height: 300px">
                <div id="maingrid2" style="margin: 10px; height: 300px;">

                    <form name="doorForm" method="post" action="" id="doorForm">
                        <div>
                        </div>


                        <table cellpadding="0" cellspacing="0" class="l-table-edit" >
                            <tr>
                                <td align="right" class="l-table-edit-td">名称:</td>
                                <td align="left" class="l-table-edit-td">
                                    <input name="name" type="text" ltype="text" />
                                </td>
                                <td align="left"></td>
                            </tr>
                            <tr>
                                <td align="right" class="l-table-edit-td">编号:</td>
                                <td align="left" class="l-table-edit-td">
                                    <input name="code" type="text" ltype="text" />
                                </td>
                                <td align="left"></td>
                            </tr>


                            <tr>
                                <td align="right" class="l-table-edit-td">方向:</td>
                                <td align="left" class="l-table-edit-td">
                                   <input name="way" type="radio" ltype="radio" />  单向
                                    <input name="way" type="radio" ltype="radio" />  双向
                                </td>
                                <td align="left"></td>
                            </tr>


                            <tr>
                                <td align="right" class="l-table-edit-td">所属区域门组:</td>
                                <td align="left" class="l-table-edit-td">
                                    <select name="ddlDepart" ltype="select">
                                        <option value="1">A</option>
                                        <option value="2">B</option>
                                        <option value="3">B</option>
                                        <option value="4">C</option>
                                        <option value="5">D</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" class="l-table-edit-td">报警时间间隔（秒）:</td>
                                <td align="left" class="l-table-edit-td">
                                    <input name="txtDate" type="text" ltype="text" />
                                </td><td align="left"></td>
                            </tr>
                            <tr>
                                <td align="right" class="l-table-edit-td">备注:</td>
                                <td align="left" class="l-table-edit-td">
                                    <textarea cols="100" rows="4" class="l-textarea" style="width:400px"></textarea>
                                </td><td align="left"></td>
                            </tr>
                        </table>
                    <br />
                    <input type="hidden" name="id" />
                    <input type="hidden" name="pid" />
                    <input type="submit" value="提交" class="l-button l-button-submit" />
                    <input type="reset" value="重置" class="l-button l-button-reset"/>
                    <br class="l-clear" />
                    </form>
                </div>
            </div>
            <div title="读卡器设置" style="padding: 5px">
                <fieldset style="float: left;">
                    <legend>基本设置</legend>

                    <table cellpadding="0" cellspacing="0" class="l-table-edit" >
                        <tr>
                            <td align="right" class="l-table-edit-td">名称:</td>
                            <td align="left" class="l-table-edit-td">
                                <input type="text" value="Reader 01" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="l-table-edit-td">超过该等级时禁用:</td>
                            <td align="left" class="l-table-edit-td">
                                <input type="text" value="99" />
                            </td>
                        </tr>
                    </table>
                </fieldset>
                <fieldset style="float: left; margin-left: 10px;">
                    <legend>逻辑设置</legend>
                    <table cellpadding="0" cellspacing="0" class="l-table-edit" >
                        <tr>
                            <td align="right" class="l-table-edit-td">该时间范围内允许“密码方式”通过:</td>
                            <td align="left" class="l-table-edit-td">
                                <select>
                                    <option>永远有效</option>
                                    <option>永远无效</option>
                                    <option>时间组1</option>
                                    <option>时间组2</option>
                                    <option>时间组3</option>
                                </select>
                            </td>
                        </tr>
                    </table>
                </fieldset>
                <br style="clear: both;" />
                <br />
                <input type="submit" value="提交" class="l-button l-button-submit" />
                <input type="reset" value="重置" class="l-button l-button-reset"/>
                <br class="l-clear" />
            </div>
            <div title="继电器设置">
                <div id="Div5" style="margin: 10px; height: 450px;">
                    <form name="doorForm2" method="post" action="" id="doorForm5">
                        <div>
                        </div>
                        <table cellpadding="0" cellspacing="0" class="l-table-edit" >
                            <tr>
                                <td align="right" class="l-table-edit-td">继电器模式:</td>
                                <td align="left" class="l-table-edit-td">
                                    <select name="ddlDepart3" ltype="select">
                                        <option value="1">常开</option>
                                        <option value="2">常闭</option>
                                        <option value="3">定时</option>
                                    </select>
                                </td>
                            </tr>

                            <tr>
                                <td align="right" class="l-table-edit-td">延时开门时间:</td>
                                <td align="left" class="l-table-edit-td">
                                    <input name="code" type="text" ltype="text" />
                                </td>
                                <td align="left">秒</td>
                            </tr>
                            <tr>
                                <td align="right" class="l-table-edit-td">开门保持时间:</td>
                                <td align="left" class="l-table-edit-td">
                                    <input name="code" type="text" ltype="text" />
                                </td>
                                <td align="left">秒</td>
                            </tr>
                        </table>
                        <br />
                        <input type="hidden" name="id" />
                        <input type="hidden" name="pid" />
                        <input type="submit" value="提交" class="l-button l-button-submit" />
                        <input type="reset" value="重置" class="l-button l-button-reset"/>
                        <br class="l-clear" />
                    </form>

                </div>
            </div>
            <div title="防反传设置">
                <div id="Div1" style="margin: 10px; height: 300px;">

                    <form name="doorForm1" method="post" action="" id="doorForm1">


                        <div>
                        </div>
                        <table cellpadding="0" cellspacing="0" class="l-table-edit" >
                            <tr>
                            <td align="right" class="l-table-edit-td">门内区域:</td>
                            <td align="left" class="l-table-edit-td">
                                <select>
                                    <option selected="selected">区域1</option>
                                    <option>区域2</option>
                                    <option>区域3</option>
                                </select>
                            </td>
                            </tr>
                            <tr>
                                <td align="right" class="l-table-edit-td">门外区域:</td>
                                <td align="left" class="l-table-edit-td">
                                    <select>
                                        <option>区域1</option>
                                        <option selected="selected">区域2</option>
                                        <option>区域3</option>
                                    </select>
                                </td>
                            </tr>
                        </table>
                        <br />
                        <input type="submit" value="提交" class="l-button l-button-submit" />
                        <input type="reset" value="重置" class="l-button l-button-reset"/>
                        <br class="l-clear" />
                        </form>

                </div>
            </div>
            <div title="防潜回设置" showclose="true">
                <div id="Div2" style="margin: 10px; height: 300px;">
                    <form class="l-hidden" name="doorForm2" method="post" action="" id="doorForm2">


                        <div>
                        </div>
                    <table cellpadding="0" cellspacing="0" class="l-table-edit" >

                        <tr>
                            <td align="right" class="l-table-edit-td">是否采用该规则:</td>
                            <td align="left" class="l-table-edit-td">
                                <input name="name" type="checkbox" ltype="checkbox" />
                            </td>
                            <td align="left"></td>
                        </tr>
                    <tr>
                        <td align="right" class="l-table-edit-td">可以进入该门的门名称:</td>
                        <td align="left" class="l-table-edit-td">
                            <input type="text" id="txt3" ltype="select"/>
                        </td>
                    </tr>
                    </table>
                    <br />
                    <input type="hidden" name="id" />
                    <input type="hidden" name="pid" />
                    <input type="submit" value="提交" class="l-button l-button-submit" />
                    <input type="reset" value="重置" class="l-button l-button-reset"/>
                    <br class="l-clear" />
                    </form>

                </div>
            </div>
        </div>
        <br />

    </div>
</div>

</body>
</html>
